import React from 'react';
import {Text, StyleSheet} from 'react-native';
import LinearGradient from 'react-native-linear-gradient';
import { normalize } from "../utils/commonUtils";

const MembershipCard = ({level, content}) => {
  let gradientColors;

  switch (level) {
    case 'silver':
      gradientColors = ['#C0C0C0', '#D3D3D3']; // 银色渐变
      break;
    case 'gold':
      gradientColors = ['#FFD700', '#FFC700']; // 金色渐变
      break;
    case 'platinum':
      gradientColors = ['#E5E4E2', '#B0C4DE']; // 白金渐变
      break;
    default:
      gradientColors = ['#FFFFFF', '#F0F0F0']; // 默认渐变
  }

  return (
    <LinearGradient colors={gradientColors} style={styles.card}>
      <Text style={styles.text}>{content}</Text>
    </LinearGradient>
  );
};

const styles = StyleSheet.create({
  card: {
    padding: 20,
    borderRadius: 3,
    alignItems: 'center',
  },
  text: {
    fontSize: normalize(18),
    color: '#fff',
    fontWeight: 'bold',
  },
});

export default MembershipCard;
